#include "stdafx.h"
#include "Sound.h"

namespace Framework {

Sound::Sound(IDirectSoundBuffer* primaryBuffer) : primaryBuffer(primaryBuffer) {
    this->buffer = NULL;
    this->buffer3d = NULL;

    if (this->primaryBuffer != NULL) {
        this->primaryBuffer->QueryInterface(IID_IDirectSoundBuffer8, (LPVOID*)&this->buffer);
        this->buffer->QueryInterface(IID_IDirectSound3DBuffer8, (LPVOID*)&this->buffer3d);
    }
}

Sound::~Sound(void) {
    d3d::Release(this->buffer);
    d3d::Release(this->buffer3d);
}

IDirectSoundBuffer8* Sound::GetBuffer() const {
    return this->buffer;
}

IDirectSound3DBuffer8* Sound::GetBuffer3D() const {
    return this->buffer3d;
}

}
